package org.example.day20240814;

import java.util.Scanner;

public class test5fuben {
    public static void main(String[] args) {
//        0-670-82162-X
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();
        String[] arr = line.split("-");
        String numStr = arr[0]+arr[1]+arr[2];
        char[] charArr = numStr.toCharArray();
        int result = 0;
        for(int i = 0; i < charArr.length;i++){
            result += (charArr[i]-'0') * (i+1);
        }
        int mod = result % 11;
        if(mod<10){
            if(!arr[3].equals("X") && mod == Integer.parseInt(arr[3])){
                System.out.println("Right");
            }
            else{
                System.out.println(arr[0]+"-"+arr[1]+"-"+arr[2]+"-"+mod);
            }
        }
        else if(mod == 10 && arr[3].equals("X")){
            System.out.println("Right");
        }
        else
        {
            System.out.println(arr[0]+"-"+arr[1]+"-"+arr[2]+"-X");
        }
    }
}
